package 多线程.线程出错案例;

public class 用户 extends Thread {
    public String name;
    public 用户(String name) {
        this.name = name;
    }
    @Override
    public void run() {
        while(银行.余额>=100){
            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            银行.余额-=100;
            System.out.println(name+"取了100元~~");
        }
            System.out.println("银行的余额不足100元~~");
        System.out.println("现在银行还有"+银行.余额+"元");
    }
}
